import java.util.Scanner;
public class test16 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num = sc.nextInt();
        int i=2;
        for (; i < num; i++) {
            if (num % i == 0) {
                System.out.println("该数不为质数");
                break;
            }
        }
            if ( i>= num/2 ) {
                System.out.println("该数为质数");
            }
        }
    }
